package com.shejimoshi.单例模式.深浅克隆.深克隆;

import java.util.*;

public class ListTest {
    public static void main(String[] args) {
        List<String> list1 = new ArrayList<>();
        list1.add("1");
        List<String> list2 = new ArrayList<>();
        list2.addAll(list1);
        list1.remove(0);
        System.out.println(list1);
        System.out.println(list2);

        Set<Integer> set1 = new HashSet<>();
        set1.add(1);
        Set<Integer> set2 = new HashSet<>();
        set2.addAll(set1);
        set1.remove(1);
        System.out.println(set1);
        System.out.println(set2);
    }
}
